<template>
  <div class="vue-box sbot sbot-fluid">
    <!-- 参数栏 -->
    <div class="c-panel">
      <el-form :inline="true">
        <!-- 表单 -->
        <sa-item v-model="m.source" type="enum" jtype="3" :jv="dims.SCS_SOURCES_TYPE" name="反馈来源" br />
        <sa-item v-model="m.type" type="enum" jtype="3" :jv="dims.FEEDBACK_TYPE" name="反馈类型" br />
        <sa-item v-model="m.status" type="enum" jtype="3" :jv="dims.DEAL_WITH_STATUS" name="处理状态" br />
        <sa-item v-model="m.note" type="textarea" name="备注" br />
        <sa-item v-model="m.sort" type="num" name="序号" br />
      </el-form>
    </div>
  </div>
</template>

<script>

export default {
  name: 'feedback-update',
  props: { param: Object },
  data() {
    return {
      // 超级对象
      m: this.createModel(),
      dims: sa.$sys.getCurd()
    }
  },
  methods: {
    createModel() {
      return {
        id: this.param.id,
        source: this.param.source,
        type: this.param.type,
        status:this.param.status,
        note: this.param.note,
        sort: this.param.sort,
        resourceId: this.param.resourceid
      }
    },
    // 变更
    ok: function () {
      // 表单校验
      let m = this.m;
      sa.checkNull(m.type, '请选择反馈类型');
      // 添加
      sa.ajax('/feedback/update', m, function (res) {
        if (res.code == 200) {
          sa.alert(res.msg, function () {
            this.m = this.createModel();
            sa.closeModel();
            sa.currView().f5();
          }.bind(this));
        }
      }.bind(this), { type: 'post' });
    }
  }
}
</script>

<style scoped></style>
